package org.hs.phd.odi.tracking
import org.hs.phd.common.framesource.FrameSource
import org.hs.phd.common.framesource.FolderFrameSource
import java.awt.Rectangle
import org.hs.phd.odi.tracking.ui.TrackingPresenter
import org.hs.phd.odi.tracking.ui.DefaultTrackingView
import javax.swing.UIManager

object TrackingMain {
    def main(args: Array[String]) = {
        setNimbusLAFIfAvailable();

        val frameSource = new FolderFrameSource(
                "D:\\Hakan_PhD\\Data\\OwnData\\KAYIT_20111123\\KAYIT_dia6_exp512\\renamed\\Image",
                ".jpg", 4125);
        frameSource.setROI(new Rectangle(205, 85, 1019, 874));

        val presenter = new TrackingPresenter(new DefaultTrackingView(), frameSource);
        presenter.start();
    }

	def setNimbusLAFIfAvailable() : Unit = {
		val installedLookAndFeels = javax.swing.UIManager.getInstalledLookAndFeels();
//		for( u <- installedLookAndFeels
//		    if u.getName() == "Nimbus" )
//		  UIManager.setLookAndFeel(u.getClassName() );
		installedLookAndFeels.foreach(u=>
		  if(u.getName() == "Nimbus"){
		    UIManager.setLookAndFeel(u.getClassName() );
		    return;
		  })
	}

}